package com.example.music

import android.app.Application
import java.lang.ref.WeakReference

class MyApplication : Application() {
    private var mainActivityRef: WeakReference<MainActivity>? = null

    val mainActivity: MainActivity?
        get() = mainActivityRef?.get()

    fun setMainActivityReference(activity: MainActivity?) {
        mainActivityRef = activity?.let { WeakReference(it) }
    }
} 